package leetcode_周赛._2021._202106._20210620;

/**
 * @author yzh
 * @version 1.0
 * @date 2021/6/20 10:47
 * 你完成的完整对局数
 */
public class _5789 {
    public static void main(String[] args) {
        System.out.println(new _5789().numberOfRounds("12:01", "12:44"));
    }

    public int numberOfRounds(String startTime, String finishTime) {
        String[] s1 = startTime.split(":");
        int a1 = Integer.parseInt(s1[0]), b1 = Integer.parseInt(s1[1]);
        String[] s2 = finishTime.split(":");
        int a2 = Integer.parseInt(s2[0]), b2 = Integer.parseInt(s2[1]);
        int x = 0, y = 0;
        if (a1 > a2) a2 += 24;
        x = (a2 - a1) * 60;
        y = b2 - b1;
        if (y < 0) x -= y;
        else x += y;
        System.out.println(x);
        return x / 15;
    }

}
